package concurrent.chapter10;

public class ThreadLocalSimpleTest {
    private static ThreadLocal<String> threadLocal = new ThreadLocal<>(){
        //初始化
        @Override
        protected String initialValue() {
            return "Alex";
        }
    };

    public static void main(String[] args) throws InterruptedException {
        //threadLocal.set("Alex");//没有指定值，则是null
        Thread.sleep(1000);
        String value = threadLocal.get();
        System.out.println(value);
    }
}
